/**
 * 菜单
 * Created by benben on 14-8-28.
 */
var express = require('express');
var View = require('../modules/system/view');
var router = express.Router();

router.get('/', function(req, res) {

    var user = req.session.user;
    console.log(user);

    View.find({status:1}, function(err, doc) {
        res.contentType('json');
        if (doc) {
            res.json({success: true, children: doc});
        }else{
            res.json({success: false, message: '菜单数据请求失败'});
        }
    });
});

module.exports = router;

